import 'package:library_base/entities/generated/json/base/json_convert_content.dart';
import 'package:library_base/entities/print_detail_entity.dart';
import 'package:library_base/entities/print_not_single_entry_details_entity.dart';
import 'package:library_base/entities/print_single_entry_details_entity.dart';

PrintDetailEntity $PrintDetailEntityFromJson(Map<String, dynamic> json) {
  final PrintDetailEntity shipperEntity = PrintDetailEntity();

  final String? shipperName = jsonConvert.convert<String>(json['shipperName']);
  if (shipperName != null) {
    shipperEntity.shipperName = shipperName;
  }
  final String? orderNumber = jsonConvert.convert<String>(json['orderNumber']);
  if (orderNumber != null) {
    shipperEntity.orderNumber = orderNumber;
  }

  final String? consignee = jsonConvert.convert<String>(json['consignee']);
  if (consignee != null) {
    shipperEntity.consignee = consignee;
  }

  final String? mobilePhone = jsonConvert.convert<String>(json['mobilePhone']);
  if (mobilePhone != null) {
    shipperEntity.mobilePhone = mobilePhone;
  }

  final String? address = jsonConvert.convert<String>(json['address']);
  if (address != null) {
    shipperEntity.address = address;
  }

  final String? shortAddress = jsonConvert.convert<String>(json['shortAddress']);
  if (shortAddress != null) {
    shipperEntity.shortAddress = shortAddress;
  }

  final String? carNo = jsonConvert.convert<String>(json['carNo']);
  if (carNo != null) {
    shipperEntity.carNo = carNo;
  }

  final String? stationTime = jsonConvert.convert<String>(json['stationTime']);
  if (stationTime != null) {
    shipperEntity.stationTime = stationTime;
  }

  final List<PrintSingleEntryDetailsEntity> singleEntryDetails =
  jsonConvert.convertList<PrintSingleEntryDetailsEntity>(json['singleEntryDetails']);
  shipperEntity.singleEntryDetails = singleEntryDetails;

  final List<PrintNotSingleEntryDetailsEntity> notSingleEntryDetails =
  jsonConvert.convertList<PrintNotSingleEntryDetailsEntity>(json['notSingleEntryDetails']);
  shipperEntity.notSingleEntryDetails = notSingleEntryDetails;

  return shipperEntity;
}

Map<String, dynamic> $PrintDetailEntityToJson(PrintDetailEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['shipperName'] = entity.shipperName;
  data['orderNumber'] = entity.orderNumber;
  data['consignee'] = entity.consignee;
  data['mobilePhone'] = entity.mobilePhone;
  data['address'] = entity.address;
  data['shortAddress'] = entity.shortAddress;
  data['carNo'] = entity.carNo;
  data['stationTime'] = entity.stationTime;
  data['singleEntryDetails'] = entity.singleEntryDetails;
  data['notSingleEntryDetails'] = entity.notSingleEntryDetails;
  return data;
}
